We present an average case analysis of a variant of dual-pivot quicksort. Weshow that the used algorithmic partitioning strategy is optimal, i.e., itminimizes the expected number of key comparisons. For the analysis, wecalculate the expected number of comparisons exactly as well as asymptotically,in particular, we provide exact expressions for the linear, logarithmic, andconstant terms. An essential step is the analysis of zeros of lattice paths in a certainprobability model. Along the way a combinatorial identity is proven.
展开▼